{ config, lib, pkgs, ... }:
{
    system = {
        autoUpgrade = {
            enable = true;
            # allowReboot 允许自动重启，rebootWindow 需要allowReboot 启用，设置可重启的时间段
            allowReboot = true;
            rebootWindow = {
               lower = "12:00";
               upper = "14:00";
            };
            ## 使用flake管理，自动更新需要禁用channel，启用flake选项
            #channel = "https://mirrors.ustc.edu.cn/nix-channels/nixos-unstable";    # unstable
            flake = "/etc/nixos#nixos"; #"github:loonor/nixos-config"; # inputs.self.outPath
            flags = [
                "--update-input"
                "nixpkgs"
                "--no-write-lock-file"
                "-L"
            ];
            dates = "weekly";
            randomizedDelaySec = "45min";
        };
    };

}
